from typing import List

class Solution:
    def validMountainArray(self, A):
        i, j = 0, len(A) - 1
        while i + 1 < len(A) - 1 and A[i] < A[i + 1]: i += 1
        while j - 1 > 0 and A[j] < A[j - 1]: j -= 1
        return i == j < len(A)


s = Solution()
assert(not s.validMountainArray([2,1]))

assert(not s.validMountainArray([3,5,5]))
assert(s.validMountainArray([0,3,2,1]))
assert(not s.validMountainArray([0,1,2,3]))

assert(not s.validMountainArray([0,2,3,2,5,2,1]))
assert(not s.validMountainArray([3,6,5,6,7,6,5,3,0]))
assert(not s.validMountainArray([3,7,6,4,3,0,1,0]))